Skip to content

Fix the fromContentUri null/short path causes substring crash - #4497

Open
siddhesh-06 wants to merge 1 commit into
TeamAmaze:release/4.0from
siddhesh-06:siddhesh06/fix/fromContentUri-null-check
Open

Fix the fromContentUri null/short path causes substring crash#4497
siddhesh-06 wants to merge 1 commit into
TeamAmaze:release/4.0from
siddhesh-06:siddhesh06/fix/fromContentUri-null-check

Conversation

@siddhesh-06

Copy link
Copy Markdown
Contributor

Description

  1. Implemented null-safety for uri.getPath()
  2. Added validation of the expected provider prefix before performing any substring operations to avoid unsafe assumptions about URI structure.
  3. Added fallback behaviour for unexpected or short paths & improved logging
  4. Prevented crashes when the constructed file does not exist

Issue tracker

Fixes #4477

Automatic tests

  • Added test cases

Manual tests

  • Done

Build tasks success

Successfully running following tasks on local:

  • ./gradlew assembledebug
  • ./gradlew spotlessCheck

@VishnuSanal VishnuSanal added the PR-Awaiting-Initial-Review DEPRECATED use PR-Code-Review-Passed or PR-Manual-Testing-Passed label Mar 21, 2026

@VishnuSanal VishnuSanal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀 thanks! :)

@VishnuSanal VishnuSanal added PR-Awaiting-Final-Review DEPRECATED use PR-Code-Review-Passed or PR-Manual-Testing-Passed and removed PR-Awaiting-Initial-Review DEPRECATED use PR-Code-Review-Passed or PR-Manual-Testing-Passed labels Mar 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR-Awaiting-Final-Review DEPRECATED use PR-Code-Review-Passed or PR-Manual-Testing-Passed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fromContentUri] Null/short path causes substring crash

2 participants